const path = require("path");
const RunPlugin = require('./plugins/run-plugin');

module.exports = {
  mode: "development",
  entry: {
    entry: './src/entry.js',
    main: './src/main.js'
  },
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: '[name].js'
  },
  cache: {
    type: 'filesystem'
  },
  devtool: false,
  resolve: {
    extensions:['.js','.jsx','.ts','.tsx']
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: [
          //最左则的loader需要返回合法的JS
          path.resolve(__dirname, 'loaders/customloader.js'),
        ]
      }
    ]
  },
  plugins: [new RunPlugin()]
};
